
// export type Params = { [key: string]: string | number | null; };
import type { AxiosRequestConfig } from 'axios';
import type { Ref } from "vue"

export interface RequestOptions<T> extends AxiosRequestConfig<T> {
  self?: any
  loading?: Ref<boolean>
  params?: T
  success: (params: any) => void;
  fail(params: any): void
}

export interface ChangeEvent extends Event {
  target: HTMLInputElement;
}
export interface Data {
  [key: string]: any;
}
// 仅能使用联合类型， 返回联合类型
export type unionPick<T, K extends T> = K

export type DateReg = {
  "M+": number
  "d+": number
  "h+": number
  "m+": number
  "s+": number
  "q+": number
  "S": number
}


export type DateRegKey = keyof DateReg

type menu = {
  name: string,
  path: string,
}

export type menus = {
  name: string,
  path: string,
  children: menu[]
}

export type Region = {
  min: number; max: number
}

export type position = {
  x: number
  y: number
}
// { posx: (x * ratio_w) / 2, posy: (y * ratio_h) / 2, pageNo: elIndex + 1 }
export type ApiXY = {
  posx: number
  posy: number
  pageNo: number
}

export type STATUS = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7";


